// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import { XHeader, XImg, XButton } from 'vux'
import axios from 'axios'
import Vuex from 'vuex'
import store from './store/index'
import CKEditor from '@ckeditor/ckeditor5-vue'
import * as filters from './filter/filter'
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.config.productionTip = false
// Object.keys 返回一个所有元素为字符串的数组，其元素来自于从给定的object上面可直接枚举的属性。这些属性的顺序与手动遍历该对象属性时的一致。
Object.keys(filters).forEach(item => {
  Vue.filter(item, filters[item])
})
Vue.use(Vuex)
Vue.use(CKEditor)
Vue.use(preview)
Vue.component('x-header', XHeader)
Vue.component('x-img', XImg)
Vue.component('x-button', XButton)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  axios,
  components: { App },
  template: '<App/>'
})
